package MultiMediaPlayer.Media.Adapter;

import MultiMediaPlayer.Interface.PlatForm;
import MultiMediaPlayer.Media.AVI;
import MultiMediaPlayer.Media.MP4;
import MultiMediaPlayer.Media.Media;


//适配器模式
public class AviAdapter implements Media {
    private final MP4 mp4;
    private final AVI avi;

    public AviAdapter(PlatForm platForm) {
        this.avi = new AVI(platForm);
        this.mp4 = new MP4(platForm);
    }

    @Override
    public void play() {
        System.out.println("正在将 AVI 文件: " + avi.getName() + " 转换为 MP4 格式播放");
        mp4.play();
    }

    @Override
    public String getDescription() {
        return avi.getDescription() + " 转换为 MP4 格式";
    }

    @Override
    public String getName() {
        return "AVI to MP4文件";
    }
}
